package com.fivefu.core.hillstone.dto.response;

import com.fivefu.core.hillstone.entity.DbHillstoneChannel;
import com.fivefu.core.hillstone.entity.DbHillstoneDevice;

/**
 * 分页获取设备通道返回Dto
 */
public class DeviceChannelDto {

    //设备类字段信息
    /**
     * 节点类型
     */
    private Integer nodeType;

    /**
     * 设备编码
     */
    private String id;

    /**
     * 节点名称
     */
    private String name;

    /**
     * 界面显示的图标名称
     */
    private String icon;

    /**
     * 设备是否在线。"1":在线；"0":离线
     */
    private String online;

    /**
     * 是否是父节点（是否有子节点），true:是父节点，false:不是父节点
     */
    private Boolean isParent;

    /**
     * 所属组织的ID，如果属于root节点则为""
     */
    private String parentId;

    /**
     * 和parentId一样(所属组织的ID，如果属于root节点则为"")
     */
    private String orgCode;

    /**
     * 组织类型，"1"为基本组织
     */
    private String orgType;

    /**
     * 排序码
     */
    private Integer sort;

    /**
     * 设备大类
     */
    private String category;

    /**
     * 设备编码
     */
    private String deviceId;

    /**
     * 智能状态，0:非智能 1:智能
     */
    private Integer intelliFlag;

    /**
     * 厂商
     */
    private String manufacturer;

    /**
     * 设备小类
     */
    private String subType;

    /**
     * 设备IP
     */
    private String ip;

    /**
     * 组织自定义编码，通常用于国标编码
     */
    private String sn;


    //通道类字段额外信息
    /**
     * 和id一样(通道编码)
     */
    private String channelId;

    /**
     * 通道是否在线。1:在线 0:离线
     */
    private Integer status;

    /**
     * 摄像头类型，"1":枪机，"2":球机，"3":半球等
     */
    private String cameraType;

    /**
     * 编码通道功能，一个通道如果支持多种功能，用","分隔。
     */
    private String cameraFunctions;

    /**
     * 和parentId一样(所属组织的ID，如果属于root节点则为"")
     */
    private String deviceCode;

    /**
     * 通道序号，从0开始
     */
    private Integer channelSeq;

    /**
     * 通道类型
     */
    private String channelType;

    /**
     * 通道所在地图坐标的X值
     */
    private String gpsX;

    /**
     * 通道所在地图坐标的Y值
     */
    private String gpsY;

    /**
     * 通道所属的单元类型
     */
    private String unitType;

    /**
     * 所属的paas编号，此值为paas基础平台所定义
     */
    private String paasId;

    /**
     * 智能状态，0:非智能 1:智能
     */
    private Integer intelliState;

    public Integer getNodeType() {
        return nodeType;
    }

    public void setNodeType(Integer nodeType) {
        this.nodeType = nodeType;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getOnline() {
        return online;
    }

    public void setOnline(String online) {
        this.online = online;
    }

    public Boolean getParent() {
        return isParent;
    }

    public void setParent(Boolean parent) {
        isParent = parent;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public String getOrgType() {
        return orgType;
    }

    public void setOrgType(String orgType) {
        this.orgType = orgType;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public Integer getIntelliState() {
        return intelliState;
    }

    public void setIntelliState(Integer intelliState) {
        this.intelliState = intelliState;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getSubType() {
        return subType;
    }

    public void setSubType(String subType) {
        this.subType = subType;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCameraType() {
        return cameraType;
    }

    public void setCameraType(String cameraType) {
        this.cameraType = cameraType;
    }

    public String getCameraFunctions() {
        return cameraFunctions;
    }

    public void setCameraFunctions(String cameraFunctions) {
        this.cameraFunctions = cameraFunctions;
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public Integer getChannelSeq() {
        return channelSeq;
    }

    public void setChannelSeq(Integer channelSeq) {
        this.channelSeq = channelSeq;
    }

    public String getChannelType() {
        return channelType;
    }

    public void setChannelType(String channelType) {
        this.channelType = channelType;
    }

    public String getGpsX() {
        return gpsX;
    }

    public void setGpsX(String gpsX) {
        this.gpsX = gpsX;
    }

    public String getGpsY() {
        return gpsY;
    }

    public void setGpsY(String gpsY) {
        this.gpsY = gpsY;
    }

    public String getUnitType() {
        return unitType;
    }

    public void setUnitType(String unitType) {
        this.unitType = unitType;
    }

    public String getPaasId() {
        return paasId;
    }

    public void setPaasId(String paasId) {
        this.paasId = paasId;
    }

    public Integer getIntelliFlag() {
        return intelliFlag;
    }

    public void setIntelliFlag(Integer intelliFlag) {
        this.intelliFlag = intelliFlag;
    }

    /**
     * 格式化通道实体类
     * @return
     */
    public DbHillstoneChannel formatDbHillstoneChannel() {
        DbHillstoneChannel channel = new DbHillstoneChannel();
        channel.setChannelCode(this.channelId);//通道编码
        channel.setName(this.name);//通道名称
        channel.setIcon(this.icon);//显示图标名称
        channel.setOnline(Integer.valueOf(this.online));//通道是否在线(0:离线,1:在线)
        channel.setSort(this.sort);//排序
        channel.setCameraType(Integer.valueOf(this.cameraType));//摄像头类型(1:枪击,2:球机,3:半球)
        channel.setOrganizationCode(this.orgCode);//所属组织编码
        channel.setDeviceCode(this.deviceCode);//所属设备编码
        channel.setChannelSeq(this.channelSeq);//通道序号,从0开始
        channel.setChannelType(this.channelType);//通道类型
        channel.setUnitType(this.unitType);//所属单元类型
        channel.setPassId(this.paasId);//所属pass编号
        channel.setIntelliState(this.intelliState);//智能状态(0:非智能,1:智能)
        return channel;
    }

    /**
     * 格式化设备实体类
     * @return
     */
    public DbHillstoneDevice formatDbHillstoneDevice() {
        DbHillstoneDevice device = new DbHillstoneDevice();
        device.setDeviceCode(this.deviceId);//设备编码
        device.setDeviceName(this.name);//设备名称
        device.setIcon(this.icon);//显示图标名称
        device.setOnline(Integer.valueOf(this.online));//是否在线(0:离线,1:在线)
        device.setOrganizationCode(this.orgCode);//所属组织编码
        device.setSort(this.sort);//排序
        device.setDeviceId(this.id);//设备编码
        device.setIntellFlag(this.intelliFlag);//智能状态(0:非智能,1:智能)
        device.setDeviceManufacturer(this.manufacturer);//厂商
        device.setSubType(this.subType);//设备小类
        device.setDeviceIp(this.ip);//设备IP
        device.setDeviceType(this.category);//设备大类
        return device;
    }
}
